package com.training.java.core.homework05;

public class Employee extends Person {

	private double cashOfIRS;

	public Employee(double cashOfOrganization, double cashOfIndividual,
			double cashOfIRS) {
		super(cashOfOrganization, cashOfIndividual);
		this.cashOfIRS = cashOfIRS;
	}

	public void activity() {
		System.out.println("Employee works at company");
	}

	@Override
	public void debit(double salary) {
		super.setCashOfIndividual(super.getCashOfIndividual() + (salary * 0.7));
		this.cashOfIRS += (salary * 0.3);

		System.out
				.println("Salary to employee debits Employee's account & IRS account");
	}

	@Override
	public void credit(double salary) {
		super.setCashOfOrganization(super.getCashOfOrganization() - salary);

		System.out.println("Salary to employee credits company's account");
	}

	public double getCashOfIRS() {
		return cashOfIRS;
	}

	public void setCashOfIRS(double cashOfIRS) {
		this.cashOfIRS = cashOfIRS;
	}
}
